﻿Rijschool.nieuweLeerling = function (params)
{
    var viewModel =
    {
        pakketen: ko.observableArray([]),
        naam: ko.observable(''),
        straat: ko.observable(''),
        huisnummer: ko.observable(''),
        postcode: ko.observable(''),
        woonplaats: ko.observable(''),
        extra: ko.observable(''),
        lesnummer: ko.observable('0'),
        pakket: ko.observable(''),
        navItems: ko.observableArray([{ text: "Terug", icon: "arrowleft" }, { text: "Log uit", icon: "close" }]),

        navItemClicked: function (e)
        {
            var c = e.itemData.text;
            if (c == "Terug")
            {
                Rijschool.app.navigate("betalingen");
            }
            else
            {
                Rijschool.app.navigate("inlog/");
            }
        },

Laad: function (test)
{
    viewModel.pakketen(JSON.parse(httpGet("http://" + window.location.host + "/Site/backend/index.php?pakketen")));
},

opslaan: function ()
{
    Rijschool.app.navigate("betalingen");
},
}
    return viewModel;
}